<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hand Analyser</title>
<link REL="SHORTCUT ICON" HREF="http://ron.motionlabclients.co.uk/pkrHands/favicon.ico">

<style type="text/css">

</style>
<link rel="stylesheet" type="text/css" href="views/themes/default/css/jquery-ui/theme/ui.all.css">
<script src="http://www.google.com/jsapi?key=ABQIAAAAdbZzzW6_p1p1VZBkc9LxYhQRazRz_hx3HcUsGZHFt1z3iV6UMhQyhI0iG0NiX4N6bc6haD8-jdJPyg" type="text/javascript"></script>
<script type="text/javascript">
		var initJquery = function(){google.load("jquery", "1.2");
		google.load("jqueryui", "1.5");

		} ; 
		try {initJquery(); } catch (e){ setTimeout("1000" , initJquery ); }
</script>
<script src="http://www.google.com/jsapi?key=ABQIAAAAdbZzzW6_p1p1VZBkc9LxYhQRazRz_hx3HcUsGZHFt1z3iV6UMhQyhI0iG0NiX4N6bc6haD8-jdJPyg" type="text/javascript"></script>
<script src="app/webroot/js/jquery-cycle.js" type="text/javascript"></script>
<script src="app/webroot/js/jquery-easing.js" type="text/javascript"></script>

<script>
	function showHandData($handID){
			//$handID = $(this).parents('.hand').attr('id');
			$('.hand').removeClass('selected');
			$('#'+$handID).addClass('selected');
			$preFlop = $('#'+$handID+' .PreFlop').html();
			$Flop = $('#'+$handID+' .Flop').html();
			$Turn = $('#'+$handID+' .Turn').html();
			$River = $('#'+$handID+' .River').html();
			$Showdown = $('#'+$handID+' .pot').html();
			
			$('#informationPane').html('<ul><li><a href="#PreFlop"><span>Pre Flop</span></a></li><li><a href="#Flop"><span>Flop</span></a></li><li><a href="#Turn"><span>Turn</span></a></li><li><a href="#River"><span>River</span></a></li><li><a href="#Showdown"><span>Result</span></a></li></ul>');
			$('#informationPane').append('<div id="PreFlop">'+$preFlop+'</div>');
			$('#informationPane').append('<div id="Flop"><p class="streetName">Flop</p>'+$Flop+'</div>');
			$('#informationPane').append('<div id="Turn"><p class="streetName">Turn</p>'+$Turn+'</div>');
			$('#informationPane').append('<div id="River"><p class="streetName">River</p>'+$River+'</div>');
			$('#informationPane').append('<div id="Showdown"><p class="streetName">Showdown</p>'+$Showdown+'</div>');
			$('#informationPane').tabs();
			if($Flop==null){$('#informationPane').tabs('disable',1)};
			//console.debug($Turn==null);
			if($Turn==null){$('#informationPane').tabs('disable',2)};
			if($River==null){$('#informationPane').tabs('disable',3)};
			//console.debug(e);
			//$('#informationPane').css('top',(e.pageY-100)+'px');
	}
	
	$('document').ready(function(){

	});
</script>
</head>

<body>


<?php
	require('models/hand_analyser.php');
	$handAnalyser = new HandAnalyser();
		$handAnalyser->historyFolder = 'userfiles';
		$handAnalyser->userName = 'ron0914';
		$handAnalyser->handDate = (isset($_REQUEST['date'])) ? $_REQUEST['date'] : '20090103';
		$handAnalyser->tableName = (isset($_REQUEST['table'])) ? $_REQUEST['table'] : 'King\'s Head.txt';

		$handAnalyser->processHandFile();
	
		//echo '<h1>User: '.$handAnalyser->userName.'</h1>';
?>		
<div class="handHistory">
	<?php $handAnalyser->getHandStats(); ?>
</div>

<div id="informationPane"></div>

</body>
</html>
